package com.dalin.platform.loa.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.TableGenerator;

import com.dalin.common.base.BaseObject;
/*****************************************************************************
 * @content: 类信息                                                   *
 * @author : 那建林                                                                                                                                 *
 * @crtDate: 2010-05-11                                                     *
 * @modDate: 2010-05-11                                                     *
 * @version: 1.00                                                           *
 ****************************************************************************/
@Entity
@Table(name="LOA_GROUP_ROLE")
public class LoaGroupRoleEntity extends BaseObject {
    private Long groupRoleId; // GROUP_ROLE_ID,16,0
    private String roleGroupName; // ROLE_GROUP_NAME,256,0
    private String roleGroupDescription; // ROLE_GROUP_DESCRIPTION,512,0





    @Id
    @Column(name="GROUP_ROLE_ID")
    @GeneratedValue(strategy = GenerationType.TABLE,generator="generator_normal")
    @TableGenerator(
        name = "generator_normal",
        table = "GLB_GENERATOR_KEY",
        pkColumnName = "GEN_KEY",
        valueColumnName = "GEN_VALUE",
        pkColumnValue = "LOA_GROUP_ROLE",
        allocationSize=1
    )
    public Long getGroupRoleId() {
        return groupRoleId;
    }

    public void setGroupRoleId(Long groupRoleId) {
        this.groupRoleId = groupRoleId;
    }

    @Column(name="ROLE_GROUP_NAME")
    public String getRoleGroupName() {
        return roleGroupName;
    }

    public void setRoleGroupName(String roleGroupName) {
        this.roleGroupName = roleGroupName;
    }

    @Column(name="ROLE_GROUP_DESCRIPTION")
    public String getRoleGroupDescription() {
        return roleGroupDescription;
    }

    public void setRoleGroupDescription(String roleGroupDescription) {
        this.roleGroupDescription = roleGroupDescription;
    }

    @Override
    public int hashCode() {
        int njlrst = 17;
        njlrst = 31 * njlrst + (groupRoleId == null ? 0 : groupRoleId.hashCode());
        njlrst = 31 * njlrst + (roleGroupName == null ? 0 : roleGroupName.hashCode());
        njlrst = 31 * njlrst + (roleGroupDescription == null ? 0 : roleGroupDescription.hashCode());
        return njlrst;
    }


    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof LoaGroupRoleEntity)) return false;
        final LoaGroupRoleEntity other = (LoaGroupRoleEntity) o;
        if (groupRoleId == null) {
            if (other.groupRoleId != null) return false;
        } else if (!groupRoleId.equals(other.groupRoleId)) {
            return false;
        }
        if (roleGroupName == null) {
            if (other.roleGroupName != null) return false;
        } else if (!roleGroupName.equals(other.roleGroupName)) {
            return false;
        }
        if (roleGroupDescription == null) {
            if (other.roleGroupDescription != null) return false;
        } else if (!roleGroupDescription.equals(other.roleGroupDescription)) {
            return false;
        }
        return true;
    }
}
